<?php
require_once "admin/config.php";
$content = trim($_POST['content']);
$time = time();
if($content !=""){
    $sql = "insert into liuyan(content,flag,time) VALUE ('$content',1,$time)";
    $rst = mysqli_query($con,$sql);
    if(mysqli_affected_rows($con)){
        echo "<script>alert('发表成功');window.location.href = 'liuyan.php';</script>";
    }else{
        echo "<script>alert('发表失败');window.location.href = 'liuyan.php';</script>";
    }
}else{
    echo "<script>alert('发表失败，不能为空');window.location.href = 'liuyan.php';</script>";
}